package com.ruoyi.ylyx.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ylyx.mapper.YlyxGameaccountMapper;
import com.ruoyi.ylyx.domain.YlyxGameaccount;
import com.ruoyi.ylyx.service.IYlyxGameaccountService;
import com.ruoyi.common.core.text.Convert;

/**
 * 用户游戏账户Service业务层处理
 * 
 * @author yuexl
 * @date 2021-02-05
 */
@Service
public class YlyxGameaccountServiceImpl implements IYlyxGameaccountService 
{
    @Autowired
    private YlyxGameaccountMapper ylyxGameaccountMapper;

    /**
     * 查询用户游戏账户
     * 
     * @param id 用户游戏账户ID
     * @return 用户游戏账户
     */
    @Override
    public YlyxGameaccount selectYlyxGameaccountById(String id)
    {
        return ylyxGameaccountMapper.selectYlyxGameaccountById(id);
    }

    /**
     * 查询用户游戏账户列表
     * 
     * @param ylyxGameaccount 用户游戏账户
     * @return 用户游戏账户
     */
    @Override
    public List<YlyxGameaccount> selectYlyxGameaccountList(YlyxGameaccount ylyxGameaccount)
    {
        return ylyxGameaccountMapper.selectYlyxGameaccountList(ylyxGameaccount);
    }

    /**
     * 新增用户游戏账户
     * 
     * @param ylyxGameaccount 用户游戏账户
     * @return 结果
     */
    @Override
    public int insertYlyxGameaccount(YlyxGameaccount ylyxGameaccount)
    {
        ylyxGameaccount.setCreateTime(DateUtils.getNowDate());
        return ylyxGameaccountMapper.insertYlyxGameaccount(ylyxGameaccount);
    }

    /**
     * 修改用户游戏账户
     * 
     * @param ylyxGameaccount 用户游戏账户
     * @return 结果
     */
    @Override
    public int updateYlyxGameaccount(YlyxGameaccount ylyxGameaccount)
    {
        ylyxGameaccount.setUpdateTime(DateUtils.getNowDate());
        return ylyxGameaccountMapper.updateYlyxGameaccount(ylyxGameaccount);
    }

    /**
     * 删除用户游戏账户对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteYlyxGameaccountByIds(String ids)
    {
        return ylyxGameaccountMapper.deleteYlyxGameaccountByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除用户游戏账户信息
     * 
     * @param id 用户游戏账户ID
     * @return 结果
     */
    @Override
    public int deleteYlyxGameaccountById(String id)
    {
        return ylyxGameaccountMapper.deleteYlyxGameaccountById(id);
    }
}
